home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 2001 November / macformat-109.iso / Demos / form•Z RadioZity Demo / form•Z RR Demo / form•Z RR Demo.rsrc / pspt_128_Postscript Pat Header < prev    next >
Encoding:
Text File  |  2001-05-14  |  6.1 KB  |  221 lines

  1. %%BeginProlog
  2. /Level2 /languagelevel where {
  3. pop languagelevel 2 ge { true } { false } ifelse
  4. } { false } ifelse def
  5.  
  6. Level2 not {
  7. %%BeginResource : procset_Adobe_Patterns_L1.0 0
  8. /PATDict 3 dict def
  9. /PATcg {
  10. 7 dict dup begin /lw currentlinewidth def /lc currentlinecap def
  11. /lj currentlinejoin def /ml currentmiterlimit def /ds [ currentdash ] def
  12. /cc [ currentrgbcolor ] def /cm matrix currentmatrix def end
  13. } bind def
  14.  
  15. /PATsg {
  16. begin
  17. lw setlinewidth
  18. lc setlinecap
  19. lj setlinejoin
  20. ml setmiterlimit
  21. ds aload pop setdash
  22. cc aload pop setrgbcolor
  23. cm setmatrix
  24. end
  25. } bind def
  26.  
  27. /setcmykcolor where { pop } {
  28. /setcmykcolor { 
  29. 1 sub 4 1 roll
  30. 3 { 3 index add neg dup 0 lt { pop 0 } if 3 1 roll } repeat
  31. setrgbcolor pop } bind def
  32. } ifelse
  33.  
  34. /PATsc { aload length
  35.     dup 1 eq { pop setgray } { 3 eq { setrgbcolor } { setcmykcolor } ifelse } ifelse
  36. } bind def
  37.  
  38. /PATtcalc {
  39. gsave exch concat matrix currentmatrix exch 
  40. 2 ne { dup 4 get exch dup 5 get exch
  41. XStep 0 dtransform round exch round exch
  42. XStep div exch XStep div exch
  43. 0 YStep dtransform round exch round exch
  44. YStep div exch YStep div exch
  45. 7 -3 roll astore
  46. } if grestore } bind def
  47.  
  48. /PATmp {
  49. exch dup length 8 add
  50. dict copy
  51. begin
  52. TilingType PATtcalc
  53. /PatternGState PATcg def
  54. PatternGState /cm 3 -1 roll put
  55. currentdict /Multi known not { /Multi 1 def } if
  56. /FontType 3 def /Encoding 256 array def 
  57. 3 string 0 1 255 { Encoding exch dup 3 index cvs cvn put } for pop
  58. /FontMatrix matrix def /FontBBox BBox def /BuildChar {
  59. mark 3 1 roll exch begin
  60. Multi 1 ne { PaintData exch get } { pop } ifelse
  61. PaintType 2 eq Multi 1 ne or
  62. { XStep 0 FontBBox aload pop setcachedevice } 
  63. { XStep 0 setcharwidth } ifelse
  64. currentdict
  65. /PaintProc load end
  66. gsave  false PATredef exec true PATredef grestore
  67. cleartomark
  68. } bind def
  69. currentdict
  70. end
  71. /foo exch definefont
  72. } bind def
  73.  
  74. /PATpcalc {
  75. PATDict /CurrentPattern get begin
  76. gsave PatternGState /cm get setmatrix
  77. BBox aload pop pop pop translate
  78. pathbbox grestore
  79. YStep div ceiling 4 1 roll XStep div ceiling 4 1 roll
  80. YStep div floor 4 1 roll XStep div floor 4 1 roll
  81. 2 index sub cvi abs exch 3 index sub cvi abs exch 4 2 roll
  82. YStep mul exch XStep mul exch end
  83. } bind def
  84.  
  85. /PATfill {
  86. PATDict /CurrentPattern get dup begin
  87. setfont PatternGState PATsg
  88. PaintType 2 eq { PATDict /PColor get PATsc } if
  89. 3 index string 0 1 Multi 1 sub { 3 index 3 index moveto
  90. Multi 1 ne { dup PaintColors exch get PATsc } if
  91. 0 1 7 index 1 sub { 2 index exch 2 index put } for pop
  92. 3 index    { currentpoint 2 index show
  93. YStep add moveto } repeat } for 5 { pop } repeat end
  94. } bind def
  95.  
  96. /oldfill /fill load def
  97. /oldeofill /eofill load def
  98. /oldstroke /stroke load def
  99. /oldshow /show load def
  100. /oldashow /ashow load def
  101. /oldwidthshow /widthshow load def
  102. /oldawidthshow /awidthshow load def
  103. /oldkshow /kshow load def
  104.  
  105. /PATredef {
  106. userdict begin { 
  107. /fill { /clip load PATdraw newpath } bind def
  108. /eofill    { /eoclip load PATdraw newpath } bind def
  109. /stroke    { PATstroke } bind def
  110. /show { 0 0 null 0 0 6 -1 roll PATawidthshow } bind def
  111. /ashow { 0 0 null 6 3 roll PATawidthshow } bind def
  112. /widthshow { 0 0 3 -1 roll PATawidthshow } bind def
  113. /awidthshow { PATawidthshow } bind def
  114. /kshow { PATkshow } bind def } {
  115. /fill { oldfill } bind def
  116. /eofill { oldeofill } bind def
  117. /stroke { oldstroke } bind def
  118. /show { oldshow } bind def
  119. /ashow { oldashow } bind def
  120. /widthshow { oldwidthshow } bind def
  121. /awidthshow    { oldawidthshow } bind def
  122. /kshow { oldkshow } bind def } ifelse
  123. end } bind def
  124. false PATredef
  125.  
  126. /PATdraw {
  127. save exch PATpcalc 5 -1 roll exec newpath PATfill restore
  128. } bind def
  129.  
  130. /PATstroke {
  131. countdictstack save mark { 
  132. currentpoint (Strokepath) = strokepath moveto 
  133. PATpcalc (Clip) = clip newpath
  134. (PATfill) = PATfill } stopped {
  135. (*** PATstroke Warning: Path is too complex, stroking with gray) =
  136. cleartomark restore
  137. countdictstack exch sub dup 0 gt { { end } repeat } { pop } ifelse
  138. gsave 0.5 setgray oldstroke grestore } { pop restore pop } ifelse newpath 
  139. } bind def
  140.  
  141. /PATsstr 1 string def
  142.             
  143. /PATawidthshow { {
  144. dup PATsstr dup 0 4 -1 roll put false charpath
  145. /clip load PATdraw currentpoint newpath moveto
  146. 3 index eq { 4 index 4 index rmoveto } if
  147. 2 copy rmoveto } forall pop pop pop pop pop
  148. currentpoint newpath moveto
  149. } bind def
  150.  
  151. /PATkshow {
  152. exch bind 1 index 0 get 0 1 4 index length 2 sub 
  153. { 3 index exch 1 add get exch 2 copy
  154. PATsstr dup 0 4 -1 roll put false charpath
  155. /clip load PATdraw currentpoint newpath moveto                    
  156. mark 3 1 roll 4 index exec cleartomark } for
  157. PATsstr dup 0 4 -1 roll put false charpath
  158. /clip load PATdraw currentpoint newpath moveto pop pop
  159. } bind def
  160.  
  161. /PATsp { 
  162. true PATredef PATDict begin
  163. /CurrentPattern exch def CurrentPattern /PaintType get 2 eq {
  164. /PColor exch def } if
  165. /CColor [ currentrgbcolor ] def end
  166. } bind def
  167.  
  168. /PATusp {
  169. false PATredef PATDict begin CColor aload pop setrgbcolor end
  170. } bind def
  171. %%EndResource
  172. } if
  173. Level2 not { save } if Level2 {
  174. %%BeginResource : procset_Adobe_Patterns_L1.0 0
  175. /PATDict 3 dict def
  176.  
  177. /PATsc {
  178. mark exch aload pop
  179. counttomark 1 eq { setgray } if
  180. counttomark 3 eq { setrgbcolor } if
  181. counttomark 4 eq { setcmykcolor } if
  182. counttomark 0 ne { setcolor } if
  183. cleartomark
  184. } bind def
  185.  
  186. /PATmp {
  187. exch dup length 2 add dict copy begin
  188. currentdict /Multi known not { /Multi 1 def } if 
  189. Multi 1 ne { /UserProc /PaintProc load def /PaintProc { begin
  190. 0 1 Multi 1 sub { PaintColors 1 index get PATsc PaintData exch get
  191. gsave  currentdict UserProc grestore } for end } bind def } if
  192. currentdict end exch makepattern
  193. } bind def
  194.  
  195. /PATsp {
  196. PATDict begin
  197. /CColor [ currentcolor ] def
  198. /CCSpace currentcolorspace def
  199. end dup /PaintType get 2 eq { exch dup length    
  200. dup 1 eq { [/Pattern /DeviceGray] setcolorspace } if
  201. dup 3 eq { [/Pattern /DeviceRGB] setcolorspace } if
  202. 4 eq { [/Pattern /DeviceCMYK] setcolorspace } if
  203. aload length 1 add -1 roll } if setpattern
  204. } bind def
  205.  
  206. /PATusp {
  207. PATDict begin CCSpace setcolorspace CColor aload pop setcolor end
  208. } bind def
  209.  
  210. %%EndResource
  211.  
  212. } if Level2 not { restore } if
  213. %%BeginProcSet: FormZ_procs
  214.  
  215. /bit_string 8 string def
  216. /bit_pattern { bit_string copy pop 9 dict begin
  217. /PatternType 1 def /PaintType 2 def /TilingType 1 def
  218. /BBox [ 0 0 1 1 ] def /XStep 1 def /YStep 1 def /Bitmap bit_string def
  219. /Matrix [8 0 0 -8 0 8] def /PaintProc {
  220. begin 8 8 true Matrix { Bitmap } imagemask end } bind def currentdict end
  221. gsave